<template>
  <h1>pinia</h1>
  <div>{{ store.count }}</div>
  <div>{{ count }}</div>
  <button @click="store.increment">add</button>
</template>

<script setup>
defineOptions({
  name: 'piniaIndex'
})

import { useCounterStore } from '@/store/pinia/counter.js'
import { computed } from 'vue'
// 在组件内部的任何地方均可以访问变量 `store` ✨
const store = useCounterStore()

const count = computed(() => store.count)
</script>
